package com.ticket.sass.ticketserver.dto.input;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Arrays;


/**
 * @author 朱其鹏
 * @date 2024/4/13 18:56
 */
public class OrderTicketSubmitInput {
    @NotNull(message = "orderNo 必传参数")
    @NotBlank(message = "orderNo 不能为空")
    private String orderNo;

    @NotNull(message = "outOrderNo 必传参数")
    @NotBlank(message = "outOrderNo 不能为空")
    private String outOrderNo;

    @NotNull(message = "sessionCode 必传参数")
    @NotBlank(message = "sessionCode 不能为空")
    private String sessionCode;

    @NotNull(message = "cellphone 必传参数")
    @NotBlank(message = "cellphone 不能为空")
    private String cellphone;

    @NotNull(message = "seatList 必传参数")
    @Valid
    private Seat[] seatList;

    private String scheduleId = "";

    private String scheduleUpdateTime = "";

    public String getSessionCode() {
        return sessionCode;
    }

    public void setSessionCode(String sessionCode) {
        this.sessionCode = sessionCode;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public Seat[] getSeatList() {
        return seatList;
    }

    public void setSeatList(Seat[] seatList) {
        this.seatList = seatList;
    }

    public String getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(String scheduleId) {
        this.scheduleId = scheduleId;
    }

    public String getScheduleUpdateTime() {
        return scheduleUpdateTime;
    }

    public void setScheduleUpdateTime(String scheduleUpdateTime) {
        this.scheduleUpdateTime = scheduleUpdateTime;
    }

    public @NotNull(message = "orderNo 必传参数") @NotBlank(message = "orderNo 不能为空") String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(@NotNull(message = "orderNo 必传参数") @NotBlank(message = "orderNo 不能为空") String orderNo) {
        this.orderNo = orderNo;
    }

    public @NotNull(message = "outOrderNo 必传参数") @NotBlank(message = "outOrderNo 不能为空") String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(@NotNull(message = "outOrderNo 必传参数") @NotBlank(message = "outOrderNo 不能为空") String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("OrderTicketSubmitInput{");
        sb.append("orderNo='").append(orderNo).append('\'');
        sb.append(", outOrderNo='").append(outOrderNo).append('\'');
        sb.append(", sessionCode='").append(sessionCode).append('\'');
        sb.append(", cellphone='").append(cellphone).append('\'');
        sb.append(", seatList=").append(Arrays.toString(seatList));
        sb.append(", scheduleId='").append(scheduleId).append('\'');
        sb.append(", scheduleUpdateTime='").append(scheduleUpdateTime).append('\'');
        sb.append('}');
        return sb.toString();
    }


    public static class Seat {
        @NotNull(message = "id 必传参数")
        @NotBlank(message = "id 不能为空")
        private String id;

        @NotNull(message = "code 必传参数")
        @NotBlank(message = "code 不能为空")
        private String code;

        @NotNull(message = "price 必传参数")
        private BigDecimal price;

        @NotNull(message = "handleFee 必传参数")
        private BigDecimal handleFee;

        @NotNull(message = "serviceFee 必传参数")
        private BigDecimal serviceFee;

        @NotNull(message = "channelServiceFee 必传参数")
        private BigDecimal channelServiceFee;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public BigDecimal getPrice() {
            return price;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }

        public BigDecimal getHandleFee() {
            return handleFee;
        }

        public void setHandleFee(BigDecimal handleFee) {
            this.handleFee = handleFee;
        }

        public BigDecimal getServiceFee() {
            return serviceFee;
        }

        public void setServiceFee(BigDecimal serviceFee) {
            this.serviceFee = serviceFee;
        }

        public BigDecimal getChannelServiceFee() {
            return channelServiceFee;
        }

        public void setChannelServiceFee(BigDecimal channelServiceFee) {
            this.channelServiceFee = channelServiceFee;
        }

        public @NotNull(message = "id 必传参数") @NotBlank(message = "id 不能为空") String getId() {
            return id;
        }

        public void setId(@NotNull(message = "id 必传参数") @NotBlank(message = "id 不能为空") String id) {
            this.id = id;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("Seat{");
            sb.append("id='").append(id).append('\'');
            sb.append(", code='").append(code).append('\'');
            sb.append(", price=").append(price);
            sb.append(", handleFee=").append(handleFee);
            sb.append(", serviceFee=").append(serviceFee);
            sb.append(", channelServiceFee=").append(channelServiceFee);
            sb.append('}');
            return sb.toString();
        }
    }
}
